- @groups.keys.sort.each do |group|
  %h2= h group.split('|').join(', ')
  %table.spaced
    %tr
      %th First Name
      %th Last Name
      %th Age
      %th Med Alerts
      %th Auths
    - @groups[group].each do |person|
      %tr
        %td= h person.first_name
        %td= h person.last_name
        %td= h person.years_of_age
        %td= h person.medical_notes
        %td
          -# TODO refactor
          - auths = person.family.people.select(&:adult?).map(&:name) + person.relationships.where("other_name like '%Check-in Person%'").to_a.map(&:related).uniq.reject(&:deleted?).map(&:name)
          - if auths.any?
            = h auths.join(', ')
            %br/
          - if person.can_pick_up.present?
            = h person.can_pick_up
            %br/
          - if person.cannot_pick_up.present?
            Can NOT pick up:
            %strike= h person.cannot_pick_up
:css
  table.spaced {
    page-break-after: always;
  }
  table.spaced th {
    white-space: nowrap;
  }
  table.spaced th,
  table.spaced td {
    text-align: left;
    padding-right: 10px;
    vertical-align: top;
    border-bottom: 1px solid #ccc;
  }
